package haiyangwangwork.day11.homework.ex2;

public class Demo1 {
    //输出1000以内的所有质数
    public static void main(String[] args) {
        for (int i = 2;i<1000;i++){
            boolean flag=true;
            for (int j=2; j<i;j++){
                if (i%j==0){
                    flag=false;
                    break;
                }
            }
            if(flag){
                System.out.println(i);
            }
        }
    }
}
